PyTorch加载模型出现Error(s) in loading state_dict() for Model问题,Unexpected key(s) in state_dict: “...“
m0_62033945:
博主你好,我在mask rcnn模型中添加了cbam以后运行validation.py时候报错:RuntimeError: Error(s) in loading state_dict for MaskRCNN:
size mismatch for backbone.fpn.inner1.channelattention.fc1.weight: copying a param with shape torch.Size(【64, 512, 1, 1】) from checkpoint, the shape in current model is torch.Size(【32, 256, 1, 1】).
size mismatch for backbone.fpn.inner1.channelattention.fc2.weight: copying a param with shape torch.Size(【512, 64, 1, 1】) from checkpoint, the shape in current model is torch.Size(【256, 32, 1, 1】).请问你知道为什么嘛
|